<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src="https://d3js.org/d3.v4.min.js"></script>

</head>
<body>


	<script type="text/javascript">

		var p = d3.select("body")
			.selectAll("p")
			.data([5, 15, 25, 35, 45]).text(function (d) {
				return d;
			});

		p.enter().append("p").text(function(d) {return d;});

		p = d3.select("body")
			.selectAll("p").data([3, 2, 1]).text(function (d) {
				return d;
			});

		p.exit().remove();



		
	</script>
</body>
</html>